/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.system.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.system.entity.ViSysRoleMap;
import com.vivo.system.dao.ViSysRoleMapDao;

/**
 * 优信通岗位映射Service
 * @author jyangye
 * @version 2018-04-16
 */
@Service
@Transactional(readOnly = true)
public class ViSysRoleMapService extends CrudService<ViSysRoleMapDao, ViSysRoleMap> {

	public ViSysRoleMap get(String id) {
		return super.get(id);
	}
	
	public List<ViSysRoleMap> findList(ViSysRoleMap viSysRoleMap) {
		return super.findList(viSysRoleMap);
	}

	public ViSysRoleMap getByViPostNameAndZone(String viPostName, String zone) {
	    ViSysRoleMap query = new ViSysRoleMap();
	    query.setViPostName(viPostName);
	    query.setZone(zone);
	    
	    List<ViSysRoleMap> retList = findList(query);
	    return retList.size() > 0 ? retList.get(0) : null;
    }
	
	public Page<ViSysRoleMap> findPage(Page<ViSysRoleMap> page, ViSysRoleMap viSysRoleMap) {
		return super.findPage(page, viSysRoleMap);
	}
	
	@Transactional(readOnly = false)
	public void save(ViSysRoleMap viSysRoleMap) {
		super.save(viSysRoleMap);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViSysRoleMap viSysRoleMap) {
		super.delete(viSysRoleMap);
	}
	
}